]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
panel: Align the arrows together in the status menus
authorJasper St. Pierre <jstpierre@mecheye.net>
Sat, 3 Aug 2013 12:30:46 +0000 (08:30 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Tue, 13 Aug 2013 10:50:24 +0000 (06:50 -0400)
To align the arrows, we need to allocate panel buttons the full
height of the tray. Fix up all of the panel buttons to support this,
and align the arrows in the middle.

https://bugzilla.gnome.org/show_bug.cgi?id=705845

js/ui/dateMenu.js
js/ui/panel.js
js/ui/panelMenu.js
js/ui/status/accessibility.js
js/ui/status/keyboard.js

index 3898606796c9dce1e63c3f77609fd942ab29ef03..b5318ba2812dc678a7a150cc4c55c24fc3ad2f83 100644 (file)
@@ -49,7 +49,7 @@ const DateMenuButton = new Lang.Class({
             menuAlignment = 1.0 - menuAlignment;
         this.parent(menuAlignment);
 
-        this._clockDisplay = new St.Label();
+        this._clockDisplay = new St.Label({ y_align: Clutter.ActorAlign.CENTER });
         this.actor.add_actor(this._clockDisplay);
         this.actor.add_style_class_name ('clock-display');
 
index 145005139854b65e8bd80c304c499dc155d4bfb1..289a90b3d4e6b10da0f2b490d1c75043518fff9b 100644 (file)
@@ -214,7 +214,9 @@ const AppMenuButton = new Lang.Class({
         this._label = new TextShadower();
         this._label.actor.y_align = Clutter.ActorAlign.CENTER;
         this._hbox.add_actor(this._label.actor);
-        this._arrow = new St.Label({ text: '\u25BE' });
+        this._arrow = new St.Label({ text: '\u25BE',
+                                     y_expand: true,
+                                     y_align: Clutter.ActorAlign.CENTER });
         this._hbox.add_actor(this._arrow);
 
         this._iconBottomClip = 0;
@@ -606,7 +608,8 @@ const ActivitiesButton = new Lang.Class({
 
         /* Translators: If there is no suitable word for "Activities"
            in your language, you can use the word for "Overview". */
-        this._label = new St.Label({ text: _("Activities") });
+        this._label = new St.Label({ text: _("Activities"),
+                                     y_align: Clutter.ActorAlign.CENTER });
         this.actor.add_actor(this._label);
 
         this.actor.label_actor = this._label;
@@ -858,7 +861,9 @@ const AggregateMenu = new Lang.Class({
         this._indicators.add_child(this._power.indicators);
         this._indicators.add_child(this._volume.indicators);
         this._indicators.add_child(this._system.indicators);
-        this._indicators.add_child(new St.Label({ text: '\u25BE' }));
+        this._indicators.add_child(new St.Label({ text: '\u25BE',
+                                                  y_expand: true,
+                                                  y_align: Clutter.ActorAlign.CENTER }));
 
         this.menu.addMenuItem(this._volume.menu);
         this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
index 5dd8d44542c4ea33ae05eb7f92f64c60801307ae..f6c48a4507b357d679c3c9c29aaa34b35ad3cc8d 100644 (file)
@@ -86,13 +86,8 @@ const ButtonBox = new Lang.Class({
             childBox.x2 = availWidth - this._minHPadding;
         }
 
-        if (natHeight <= availHeight) {
-            childBox.y1 = Math.floor((availHeight - natHeight) / 2);
-            childBox.y2 = childBox.y1 + natHeight;
-        } else {
-            childBox.y1 = 0;
-            childBox.y2 = availHeight;
-        }
+        childBox.y1 = 0;
+        childBox.y2 = availHeight;
 
         child.allocate(childBox, flags);
     },
index 149c84aae47e7ef0458164794623c0a9ae00cf98..35d92e2bd879bd1de1dc2064d7bf9a5f47144b58 100644 (file)
@@ -1,5 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
+const Clutter = imports.gi.Clutter;
 const Gio = imports.gi.Gio;
 const Lang = imports.lang;
 const Mainloop = imports.mainloop;
@@ -39,7 +40,9 @@ const ATIndicator = new Lang.Class({
         this._hbox = new St.BoxLayout({ style_class: 'panel-status-menu-box' });
         this._hbox.add_child(new St.Icon({ style_class: 'system-status-icon',
                                            icon_name: 'preferences-desktop-accessibility-symbolic' }));
-        this._hbox.add_child(new St.Label({ text: '\u25BE' }));
+        this._hbox.add_child(new St.Label({ text: '\u25BE',
+                                            y_expand: true,
+                                            y_align: Clutter.ActorAlign.CENTER }));
 
         this.actor.add_child(this._hbox);
 
index ea365c4c04dd75c7d0f4c5bf354f7a64726a294e..daa757dbfc378de5f4af88e5c1edc8f8a59b5693 100644 (file)
@@ -340,9 +340,11 @@ const InputSourceIndicator = new Lang.Class({
 
         this._hbox = new St.BoxLayout({ style_class: 'panel-status-menu-box' });
         this._hbox.add_child(this._container);
-        this._hbox.add_child(new St.Label({ text: '\u25BE' }));
+        this._hbox.add_child(new St.Label({ text: '\u25BE',
+                                            y_expand: true,
+                                            y_align: Clutter.ActorAlign.CENTER }));
 
-        this.actor.add(this._hbox, { y_expand: true });
+        this.actor.add_child(this._hbox);
         this.actor.add_style_class_name('panel-status-button');
 
         // All valid input sources currently in the gsettings
@@ -906,7 +908,7 @@ const InputSourceIndicator = new Lang.Class({
 
         for (let i in this._inputSources) {
             let is = this._inputSources[i];
-            is.indicatorLabel.allocate_align_fill(box, 0.5, 0, false, false, flags);
+            is.indicatorLabel.allocate_align_fill(box, 0.5, 0.5, false, false, flags);
         }
     }
 });